import request from '@/utils/request'

// 查询模板列表
export function listPattern(query) {
  return request({
    url: '/sora/template/list',
    method: 'get',
    params: query
  })
}

// 保存模板
export function savePattern(info) {
  return request({
    url: '/sora/template',
    method: info.tempId?'put':'post',
    data: info
  })
}

// 删除模板
export function deletePattern(ids) {
  return request({
    url: '/sora/template/'+ids,
    method: 'delete'
  })
}

// 模板详情
export function detailPattern(id) {
  return request({
    url: '/sora/template/'+id,
    method: 'get'
  })
}

// 文档结构
export function articleStructure(){
  return request({
    url:'/sora/cate/list',
    method:'get'
  })
}

// 模板节点内容列表
export function patternContentInfo(params){
  return request({
    url:'/sora/templateCont/list',
    method:'get',
    params:params
  })
}

// 保存模板内容
export function savePatternContent(data){
  return request({
    url:'/sora/templateCont',
    method:data.contId?'put':'post',
    data:data
  })
}

// 模板节点单个内容详情
export function detailPatternContent(id) {
  return request({
    url: '/sora/templateCont/'+id,
    method: 'get'
  })
}

// 删除模板内容
export function deletePatternContent(ids) {
  return request({
    url: '/sora/templateCont/'+ids,
    method: 'delete'
  })
}

// 变更排序
export function saveSort(info){
  return request({
    url:'/sora/templateCont/setSort',
    method:'post',
    data:info
  })
}